package com.xzw.test.springcloud.alibaba.controller;

import com.xzw.test.springcloud.alibaba.api.EmailCodeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmailController {

    //@Reference(check = false)
    @DubboReference
    private EmailCodeService emailCodeService;

    @GetMapping("/send")
    public void sendEmail(){
        emailCodeService.email("xiaoyang@126.com","123456");
    }

    @GetMapping("/hello")
    public String hello() {
        System.out.println("Hello spring cloud alibaba dubbo");
       return "Hello spring cloud alibaba dubbo";
    }


}
